package com.feige.service;


import com.feige.pojo.SecurityUser;
import com.feige.pojo.dto.LoginFormDto;
import com.feige.pojo.dto.RegisterFormDto;
import com.feige.result.AjaxResult;


import javax.servlet.http.HttpServletRequest;

/**
 * @author feige
 */
public interface IndexService {

    /**
     * 登出
     * @author: feige
     * @date: 2021/3/1 19:29
      * @param	token
     * @return: com.feige.utils.result.AjaxResult
     */
    AjaxResult logout(String token);

    /**
     * 登录
     * @param loginFormDto
     * @return
     */
    SecurityUser login(LoginFormDto loginFormDto);


    /**
     * 注册
     * @param registerFormDto
     * @return
     */
    SecurityUser register(RegisterFormDto registerFormDto);


    /**
     * 通过token获取用户信息
     * @param request
     * @return
     */
    SecurityUser getInfo(HttpServletRequest request);

    /**
     * 发送邮箱验证码
     * @param email
     * @return
     */
    boolean senderEmailCode(String email);

    /**
     * 验证邮箱
     * @param email
     * @param code
     * @return
     */
    void validateEmail(String email, String code);


}
